package com.hbpu.encap.homework02;

public class Homework06 {
    public static void main(String[] args) {
        Car car = new Car(30.0);
        car.new Air().flow();
        Car car1 = new Car(44.0);
        car1.new Air().flow();
        Car car2 = new Car(-11.0);
        car2.new Air().flow();
        Car car3 = new Car(0);
        car3.new Air().flow();
    }
}

class Car{
    private double temperature;

    public Car(double temperature) {
        this.temperature = temperature;
    }

    class Air {
        public void flow() {
            if (temperature >= 40) {
                System.out.println("空调吹冷风！");
            } else if (temperature <= 0) {
                System.out.println("空调吹热风！");
            } else {
                System.out.println("空调关闭！");
            }
        }
    }
}